package longshu.data.controller;

import longshu.data.common.RetV;
import longshu.data.service.ProvinceCityAreaService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * ProvinceCityAreaController
 *
 * @author LongShu 2018-02-03
 */
@RestController
public class ProvinceCityAreaController extends BaseController<ProvinceCityAreaService> {

    @GetMapping("/provinces")
    public RetV queryProvinceList() {
        return RetV.ok(service.queryProvinceList());
    }

    @GetMapping("/region/{pc}")
    public RetV queryRegionList(@PathVariable Integer pc) {
        return RetV.ok(service.queryRegionList(pc));
    }

    @GetMapping("/address/{code}")
    public RetV queryAddress(@PathVariable Integer code) {
        return RetV.ok(service.queryAddress(code));
    }

}
